<template>
  <view class="box">
    <!-- 搜索 -->
    <view class="search-box" @click="onSearch">
      <search-bar></search-bar>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    //搜索
    onSearch() {
      // console.log(111)
      uni.navigateTo({ url: "/subpkg/search/index" });
    },
  },
};
</script>

<style lang="scss" scoped>
//解决搜索框固定定位塌陷问题
.box::before {
  content: "";
  display: flex;
  clear: both;
  /* height: 0;overflow: hidden; 为了解决 IE 浏览器的兼容问题 */
  height: 50px;
  overflow: hidden;
  /* visibility:hidden;为了去隐藏content中的内容 */
  visibility: hidden;
}
//搜索
.search-box {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2;
}
</style>
